package com.webapp.stockwatcher.client;

import java.io.IOException;
import java.util.Map;

import com.google.gwt.dev.util.collect.HashMap;
import com.webapp.stockwatcher.facebook.Facebook;
import com.webapp.stockwatcher.facebook.FacebookObject;



public class Test {
	public static void main(String[] args) throws IOException {
		
		Map<String,String> userLocationMap = new HashMap<String, String>();
		
		Facebook f = new Facebook("126494412964|2.AQAxq4g3Ye__qU_e.3600.1311285600.0-511183593|o5aXU2sdgmlxZ3EVC7uLf7FFsB8");
		
		FacebookObject me = f.api("me", "friends");
	
		System.out.println("The number of friends you have is = " + me.friends.data.length);
		for(int i = 0; i< me.friends.data.length; i++){
			FacebookObject friend = f.api(me.friends.data[i].getId());
			
			if(friend.location != null){
				//System.out.println(i + " : " + friend.getName() + " : " + friend.location.getName());
				userLocationMap.put(friend.getName(), friend.location.getName());
			}
			
		}
		System.out.println("The number of friends you have is = " + me.friends.data.length);
		
		/*me = f.api("1069118333", "photos");
		System.out.println(me.photos.data[1].getWidth()); // Outputs the width of the current logged in user's second photo.
		
		FacebookObject album = f.api("99394368305");
		System.out.println(album.getCount()); // Outputs the number of photos in this album.
		
		FacebookObject photo = f.api("98423808305", 1);
		System.out.println(photo.comments.data[3].getMessage()); // Outputs the message of the 4th comment on this picture.
		System.out.println(photo.metadata.getComments()); // Outputs the URl to this photo's comments.
*/		
		
			
	}
}
